import fetch from 'utils/fetch';

// 2. 查询列表要闻
export function getListNews() {
  const data = {};
  return fetch({
    url: '/agentBulletinBoard/listNews',
    method: 'post',
    data
  });
}

// 11. 经销商左侧公告(2),右侧资料(3)查看更多(分页查询)
export function getListPage(curPage, pageSize, type, userId) {
  const data = {
    type, // type必须传(左侧公告传2,右侧资料传3)
    userId
  };
  return fetch({
    url: `/agentBulletinBoard/pageAgentBulletinBoard/${curPage}/${pageSize}`,
    method: 'post',
    data
  });
}

// 12. 经销商右侧列表查询
export function getRightList(userId) {
  const data = {
    userId
  };
  return fetch({
    url: '/agentBulletinBoard/listAgentRightBulletinBoard',
    method: 'post',
    data
  });
}

// 13. 经销商左侧列表查询
export function getLeftList(userId) {
  const data = {
    userId
  };
  return fetch({
    url: '/agentBulletinBoard/listAgentLeftBulletinBoard',
    method: 'post',
    data
  });
}

// 14. 经销商页面查看单个要闻,公告,下载资料(经销商下载需调此接口,生成记录)
export function seeDetailsByAgent(articleId, orgUserId) {
  const data = {
    articleId,
    orgUserId
  };
  return fetch({
    url: '/agentBulletinBoard/seeDetailsByAgent',
    method: 'post',
    data
  });
}